package com.atguigu04.example.exer5_objarr1;

/**
 * @ClassName: StudentTest
 * @Package: com.atguigu04.example.exer5_objarr1
 * @Description:
 * @Author 张居然
 * @Create 2024/1/13 20:38
 * @Version 1.0
 */
public class StudentTest {
    public static void main(String[] args) {
        Student[] students = new Student[20];  //对象数组
        //给数组中每一个元素赋值
        for (int i = 0; i < students.length; i++) {
            students[i] = new Student(); //为每个元素构造一个实例
            students[i].number = i + 1;
            students[i].state = (int) (Math.random() * 6 + 1);
            students[i].score = (int) (Math.random() * 101);
        }
        Util util = new Util();
        util.printStudentWithState(students,3);
        System.out.println("******************");
        util.studentSort(students);
        util.printStudentInfo(students);
    }
}
